/*
 * Styles from the toggle switch library.
 */

/*
 * CSS TOGGLE SWITCH
 *
 * Ionuț Colceriu - ghinda.net
 * https://github.com/ghinda/css-toggle-switch
 *
 */

/* Hide by default. */
.switch-toggle a,
.switch-light span span {
	display: none;
}

/* Only target browsers with support for media queries. */
@media only screen {
	.switch-light,
	.switch-toggle {
		position: relative;
		display: block;
		padding: 0 !important;
	}

	.switch-light::after,
	.switch-toggle::after {
		clear: both;
		content: "";
		display: table;
	}

	.switch-light *,
	.switch-light *:before,
	.switch-light *:after,
	.switch-toggle *,
	.switch-toggle *:before,
	.switch-toggle *:after {
		box-sizing: border-box;
	}

	.switch-light a,
	.switch-toggle a {
		display: block;
		-webkit-transition: all 0.2s ease-out;
		-moz-transition: all 0.2s ease-out;
		transition: all 0.2s ease-out;
	}

	.switch-light label,
	.switch-light > span,
	.switch-toggle label,
	.switch-toggle > span,
	.switch-light-visual-label {
		line-height: 2;
		vertical-align: middle;
	}

	.switch-light input {
		position: absolute;
		opacity: 0;
		z-index: 3;

		/* Override core style. */
		&[type=radio].disabled,
		&[type=radio].disabled:checked:before,
		&[type=radio]:disabled,
		&[type=radio]:disabled:checked:before {
			opacity: 0;
		}
	}

	.switch-light input:checked ~ span a {
		right: 0%;
	}

	/* Inherit from label. */
	.switch-light strong {
		font-weight: inherit;
	}

	.switch-light > span {
		position: relative;
		min-height: 2em;
		padding: 0;
		text-align: left;
	}

	.switch-light span span {
		position: relative;
		z-index: 2;
		display: block;
		float: left;
		width: 50%;
		text-align: center;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}

	.switch-light a {
		position: absolute;
		right: 50%;
		top: 0;
		z-index: 1;
		display: block;
		width: 50%;
		height: 100%;
		padding: 0;
	}

	.switch-toggle input {
		position: absolute;
		left: 0;
		opacity: 0;

		/* Override core style. */
		&[type=radio].disabled,
		&[type=radio].disabled:checked:before,
		&[type=radio]:disabled,
		&[type=radio]:disabled:checked:before {
			opacity: 0;
		}
	}

	.switch-toggle input + label {
		float: left;
		padding: 0 0.5em;
		margin: 0;
		text-align: center;
	}

	.switch-toggle input:checked + label {
		position: relative;
		z-index: 2;
	}

	.switch-toggle a {
		position: absolute;
		top: 0;
		left: 0;
		padding: 0;
		z-index: 1;
		width: 10px;
		height: 100%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(4),
	.switch-toggle label:nth-child(2):nth-last-child(4) ~ label,
	.switch-toggle label:nth-child(2):nth-last-child(4) ~ a {
		width: 50%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(4) ~ input:checked:nth-child(3) + label ~ a {
		left: 50%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(6),
	.switch-toggle label:nth-child(2):nth-last-child(6) ~ label,
	.switch-toggle label:nth-child(2):nth-last-child(6) ~ a {
		width: 33.33%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(6) ~ input:checked:nth-child(3) + label ~ a {
		left: 33.33%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(6) ~ input:checked:nth-child(5) + label ~ a {
		left: 66.66%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(8),
	.switch-toggle label:nth-child(2):nth-last-child(8) ~ label,
	.switch-toggle label:nth-child(2):nth-last-child(8) ~ a {
		width: 25%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(8) ~ input:checked:nth-child(3) + label ~ a {
		left: 25%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(8) ~ input:checked:nth-child(5) + label ~ a {
		left: 50%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(8) ~ input:checked:nth-child(7) + label ~ a {
		left: 75%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(10),
	.switch-toggle label:nth-child(2):nth-last-child(10) ~ label,
	.switch-toggle label:nth-child(2):nth-last-child(10) ~ a {
		width: 20%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(10) ~ input:checked:nth-child(3) + label ~ a {
		left: 20%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(10) ~ input:checked:nth-child(5) + label ~ a {
		left: 40%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(10) ~ input:checked:nth-child(7) + label ~ a {
		left: 60%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(10) ~ input:checked:nth-child(9) + label ~ a {
		left: 80%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12),
	.switch-toggle label:nth-child(2):nth-last-child(12) ~ label,
	.switch-toggle label:nth-child(2):nth-last-child(12) ~ a {
		width: 16.6%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12) ~ input:checked:nth-child(3) + label ~ a {
		left: 16.6%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12) ~ input:checked:nth-child(5) + label ~ a {
		left: 33.2%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12) ~ input:checked:nth-child(7) + label ~ a {
		left: 49.8%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12) ~ input:checked:nth-child(9) + label ~ a {
		left: 66.4%;
	}

	.switch-toggle label:nth-child(2):nth-last-child(12) ~ input:checked:nth-child(11) + label ~ a {
		left: 83%;
	}

	.switch-candy a {
		box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.45);
	}
}

/*
 * Bugfix for older Webkit, including mobile Webkit. Adapted from
 * http://css-tricks.com/webkit-sibling-bug/
 */
@media only screen and (-webkit-max-device-pixel-ratio: 2) and (max-device-width: 80em) {
	.switch-light,
	.switch-toggle {
		-webkit-animation: webkitSiblingBugfix infinite 1s;
	}
}

@-webkit-keyframes webkitSiblingBugfix {
	from {
		-webkit-transform: translate3d(0, 0, 0);
	}
	to {
		-webkit-transform: translate3d(0, 0, 0);
	}
}


/*
 * Custom styles.
 */
.fieldset-switch-toggle label {
	float: none;
}

@media only screen {
	.fieldset-switch-toggle legend {
		float: left;
		box-sizing: border-box;
		min-width: 200px;
		margin: 8px 0;
		padding-right: 16px;
		line-height: 2;
		vertical-align: middle;
	}

	.fieldset-switch-toggle .disabled-note {
		clear: both;
	}

	.switch-container__has-help legend,
	.switch-container__has-help .switch-light-visual-label {
		float: left;
		min-width: 0;
		padding-right: 0;
	}

	.switch-container__has-help .yoast_help.yoast-help-button {
		margin: 8px 0 0 4px;
	}

	.switch-toggle.switch-yoast-seo,
	.switch-light.switch-yoast-seo > span {
		width: 250px;
		border: 1px solid #ccc;
		border-radius: 0.5em;
		background-color: #dcdcdc;
		box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
	}

	.switch-toggle.switch-yoast-seo,
	.switch-light.switch-yoast-seo {
		clear: both;
		float: left;
	}

	.switch-light.switch-yoast-seo > span {
		/* To contain floats instead of the original overflow: hidden;. */
		display: inline-block;
		/* To make the focus style fully visible. */
		overflow: visible;
	}

	.switch-toggle.switch-yoast-seo a,
	.switch-light.switch-yoast-seo a {
		border: 1px solid #b5b5b5;
		border-radius: 0.5em;
		background: #a4286a;
	}

	.switch-toggle.switch-yoast-seo input.disabled + a,
	.switch-toggle.switch-yoast-seo input.disabled ~ a,
	.switch-toggle.switch-yoast-seo input:disabled + a,
	.switch-toggle.switch-yoast-seo input:disabled ~ a {
		background: #9b9b9b;
		border: 0;
	}

	.switch-toggle.switch-yoast-seo input:focus ~ span a,
	.switch-light.switch-yoast-seo input:focus ~ span a,
	.switch-toggle.switch-yoast-seo input:focus + label,
	.switch-light.switch-yoast-seo input:focus + label {
		/* Reset focus style. */
		outline: none;
	}

	.switch-toggle.switch-yoast-seo input:focus ~ a,
	.switch-light.switch-yoast-seo input:focus ~ span a {
		border-color: #5b9dd9 !important;
		box-shadow: 0 0 2px rgba(0, 115, 170, 0.8) !important;
	}

	.switch-toggle.switch-yoast-seo input:checked ~ span a,
	.switch-light.switch-yoast-seo input:checked ~ span a {
		border: 1px solid #b5b5b5;
		background: #a4286a;
	}

	.switch-light.switch-yoast-seo span span,
	.switch-light.switch-yoast-seo input:checked ~ span span:first-child,
	.switch-toggle.switch-yoast-seo label {
		color: #333;
		text-shadow: none;
		font-weight: inherit;
	}

	.switch-candy.switch-yoast-seo input ~ span span:first-child,
	.switch-candy.switch-yoast-seo input:checked ~ span span:nth-child(2),
	.switch-candy.switch-yoast-seo input:checked + label {
		color: #fff;
		text-shadow: none;
	}

	// Makes the checkboxes switch toggle clickable by using a pseudo element
	// for the checked checkbox label and by making it full width.
	.switch-candy.switch-yoast-seo input + label::after {
		content: "";
		display: block;
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 3;
	}

	// Remove the pseudo element for the non-checked checkboxes.
	.switch-candy.switch-yoast-seo input:checked + label::after {
		content: none;
	}

	.switch-light.switch-yoast-seo-reverse input:checked ~ span a {
		left: 0;
	}

	.switch-light.switch-yoast-seo-reverse a {
		left: 50%;
	}

	.switch-light.switch-yoast-seo-reverse span span {
		float: right;
	}

	.switch-toggle.switch-yoast-seo label,
	label.switch-light.switch-yoast-seo {
		margin-left: 0;
		/*
		 * To help old iOS: ensure labels have cursor pointer instead of
		 * using the empty onclick hack.
		 */
		cursor: pointer;
	}

	.switch-toggle.switch-yoast-seo input.disabled + label,
	.switch-toggle.switch-yoast-seo input:disabled + label {
		cursor: not-allowed;
	}

	.switch-yoast-seo .switch-yoast-seo-jaws-a11y {
		/* IE11 and JAWS 17.0 need this hack. */
		display: block;
		overflow: hidden;
		height: 1px;
		margin-bottom: -1px;
	}

	.switch-toggle.switch-yoast-seo label code,
	.switch-light.switch-yoast-seo label code {
		background-color: inherit;
		vertical-align: top;
	}

	.switch-light-visual-label {
		display: block;
		margin: 8px 0;
		font-weight: 400;
		line-height: 2;

		&__strong {
			font-weight: 600;
		}
	}

	.switch-container {
		clear: both;
		margin: 0 0 0.8em 0;
	}

	.switch-container + .switch-container {
		margin-top: 8px;
	}

	.switch-container + p {
		margin: 0 0 16px 0;
	}
}
